package com.example.mybasedemo.app.model.logic;

import android.content.Context;

import com.example.mybasedemo.Framewrok.net.http.HttpUtils;
import com.example.mybasedemo.Framewrok.net.transformer.DefaultTransformer;
import com.example.mybasedemo.app.api.MainApi;
import com.example.mybasedemo.app.model.ParamsMapUtils;
import com.example.mybasedemo.app.presenter.MianContract;

import java.util.List;

import rx.Observable;

/**
 * Created by dell on 2018/3/13.
 */

public class MainModelLogic implements MianContract.Model {
    @Override
    public Observable<List<TopLineListModel>> getModelVideoAllCate(Context context,String currentPage,String newsClassId) {
        return HttpUtils.getInstance(context)
                .getRetofitClinet()
                .builder(MainApi.class)
                .getVideoHotColumn(ParamsMapUtils.getHomeCate(currentPage,newsClassId))
//               进行预处理
                .compose(new DefaultTransformer<>());
    }
}
